module UsersHelper
	def gravatar_for(user,size=(flag=true,40))
		gravatar_id = Digest::MD5::hexdigest(user.email.downcase)
    	gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}"
    	unless flag.nil?
    		image_tag(gravatar_url, alt: user.name, class: "gravatar")
    	else
    		image_tag(gravatar_url, alt: user.name, class: "gravatar",size:size.to_s)
    	end
	end
end
